"$Id: dot_vimrc 72 2010-11-11 07:01:42Z dingyy.pku $
"
set nocompatible

" source stuffs
"source $VIMRUNTIME/gvimrc_example.vim
"source $VIMRUNTIME/vimrc_example.vim
"source $VIMRUNTIME/filetype.vim
"source $VIMRUNTIME/ftplugin.vim
"source $VIMRUNTIME/scripts.vim
"source $VIMRUNTIME/synmenu.vim

" encoding setting
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,latin1

" keymap
"cnorea ej e ++enc=japan
"cnorea ep e ++enc=prc
"cnorea et e ++enc=taiwan
"cnorea el e ++enc=utf-16le
"cnorea eb e ++enc=utf-16be


" use indents of 4 spaces, and have them copied down lines:
set shiftwidth=4
set shiftround
set expandtab
set autoindent

set softtabstop=4
set shiftwidth=4
set tabstop=4
set expandtab

" normally don't automatically format `text' as it is typed, IE only do this
" with comments, at 79 characters:
"set formatoptions-=t
"set textwidth=79

" * Keystrokes -- Moving Around

" have the h and l cursor keys wrap between lines (like <Space> and <BkSpc> do
" by default), and ~ covert case over line breaks; also have the cursor keys
" wrap in insert mode:
set whichwrap=b,s,h,l,~,[,],<,>


" page down with <Space> (like in `Lynx', `Mutt', `Pine', `Netscape Navigator',
" `SLRN', `Less', and `More'); page up with - (like in `Lynx', `Mutt', `Pine'),
" or <BkSpc> (like in `Netscape Navigator'):
noremap <Space> <PageDown>
noremap <BS> <PageUp>
noremap - <PageUp>
" [<Space> by default is like l, <BkSpc> like h, and - like k.]

" scroll the window (but leaving the cursor in the same place) by a couple of
" lines up/down with <Ins>/<Del> (like in `Lynx'):
noremap <Ins> 2<C-Y>
noremap <Del> 2<C-E>

"colorscheme elflord

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

syntax on
set autoindent
set autowrite

" set path for find
set path=.,/usr/include,,~/**

set diffexpr=MyDiff()
function MyDiff()
  let opt = ''
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  silent execute '!d:\Vim\vim62\diff -a ' . opt . '"' . v:fname_in . '"
  "' . v:fname_new . '" > "' . v:fname_out . '"'
  endfunction

map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-H> <C-W>h<C-W><bar>
map <C-l> <C-W>l<C-W><bar>

set wmh=0
set wmw=0
